.navbar.navbar-inverse.navbar-fixed-top.top-navbar
  .navbar-inner
    .container
      a.btn.btn-navbar(data-toggle='collapse', data-target='.nav-collapse')
        span.icon-bar
        span.icon-bar
        span.icon-bar
      a.brand(href='/')= locals.site_name
      .divider-vertical
      if current_user
        if notification_count > 0
          a.notification-indicator.tooltipped.downwards.contextually-unread(href='/notifications', title='你有#{notification_count}条未读提醒，去看看吧')
            span.mail-status.unread
        else 
          a.notification-indicator.tooltipped.downwards(href='/notifications', title='暂时没有未读提醒')
            span.mail-status
        .divider-vertical
      .nav-collapse.collapse
        ul.nav
          li
            a(href='/topics') 社区
          li
            a(href='/members') 成员
      // /.nav-collapse
      form.navbar-search.pull-left.J_search(action='/search', method='get')
        input.search-query(type='text', placeholder='', x-webkit-speech='', name='q')
      .nav-collapse.collapse.pull-right
        ul.nav.account-menu
          if current_user
            li
              a.avatar(href='/u/#{current_user.username}')
                img(src="#{userAvatarUrl(current_user, 's')}", width='20', height='20')
            li
              a(href='/u/#{current_user.username}')= current_user.username
            li
              a(href='/setting')
                i.icon-cogs
            li
              a(href='/logout')
                i.icon-signout
          else
            li
              a(href='/login')
                i.icon-signin
            li
              a.btn.btn-small(href='/register') 注册
